package com.lastproject.web.bean;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;

import com.lastproject.ejb.dao.CheckPermissionDAORemote;

@ManagedBean
public class ControllerBean {

	@EJB
	CheckPermissionDAORemote fbr;

	public boolean canCRUDOnEmployees() {
		return fbr.hasEmployeeManagementRights(true)
				|| fbr.hasCrudOnEmployeesRights(true)
				|| fbr.hasCrudOnEmployeesByDepartmentRights(true);
	}

	public boolean canViewEmployeeManagement() {
		return fbr.hasEmployeeManagementRights(true);
	}

	public boolean canViewCandidateManagement() {
		return fbr.hasCandidateManagementRights(true);
	}

	public boolean canViewDepartmentManagement() {
		return fbr.hasDepartmentManagementRights(true);
	}

	public boolean canViewTeamManagement() {
		return fbr.hasTeamManagementRights(true);
	}

	public boolean canViewLibraryManagement() {
		return fbr.hasLibraryManagementRights(true);
	}

	public boolean canViewAccounting() {
		return fbr.hasAccountingRights(true);
	}

	public boolean canViewSurveyManagement() {
		return fbr.hasSurveyManagementRights(true);
	}

	public boolean canManageLibrary() {
		return fbr.hasLibraryRights(true);
	}

	/*
	 * RAPOARTE
	 */
	public boolean canCreateConfidentialReport() {
		return fbr.hasCreateConfidentialReportsRights(true);
	}

	public boolean canViewReportsManagement() {
		return fbr.hasCreateConfidentialReportsRights(true)
				|| fbr.hasCreateGeneralReportsRights(true)
				|| fbr.hasOpenConfidentialReportsRights(true)
				|| fbr.hasOpenGeneralReportsRights(true);
	}

	public boolean canViewCreateReports() {
		return fbr.hasCreateConfidentialReportsRights(true)
				|| fbr.hasCreateGeneralReportsRights(true);
	}

	public boolean canViewOpenReports() {
		return fbr.hasOpenConfidentialReportsRights(true)
				|| fbr.hasOpenGeneralReportsRights(true);
	}

}
